angular.module("app").service("activity", ["$rootScope", "utils", "userInfo","$state", function($rootScope, utils, userInfo,$state) {
	/*下载APP*/
	this.download = function() {
		location.href = "http://a.app.qq.com/o/simple.jsp?pkgname=com.beikbank.android"
	}
	/*获取user_code*/
	this.getUser_code = function() {
		if($rootScope.isapp) {
			return wv.getid()
		} else {
			return userInfo.user_code
		}
	}
	
	/*获取加密user_code*/
	this.getUser_code2 = function() {
		if($rootScope.isapp) {
			return wv.getid2()
		} else {
			return userInfo.user_code
		}
	}
	

	/*关闭当前页*/
	this.web_close = function() {
		if($rootScope.isapp) {
			wv.close()
		} else {
			$state.go("home")
		}
	}

	/*关闭APP右上角按钮*/
	this.right_close = function() {
		if($rootScope.isapp) {
			wv.rightShow(false)
		}
	}

	this.Prize = -1 /*抽奖活动中奖奖项*/

}])